{if $Sys_CurrentUser->getIsGuest()}
<script src="{$Sys_JsLibsURL}/common/md5.js" type="text/javascript"></script>
{literal}	
<script language="JavaScript">

window.addEvent('domready', function() {
	var field = $('username');
	field.focus();

});
        var oc=0;
		var step;
		var speed;
		
		fStart = function fadeIn() {
		
			objects = new Array(tl, tc, tr, ml, mr, bl, bc, br);
			for (var i = 0; i < objects.length; ++i) {
				objects[i].style.filter="Alpha(opacity="+oc+", finishopacity=0, style=0)";
			}
			
			if(oc<=0 || (oc<30 && step<0)) {
				step = 3;
				speed = 40;
			}
			
			//kleinere schritte ab?? 
			if(step>0 && oc<40) {
				speed = speed+2;
			}
			
			if(oc>=100) {
				step=-3; 
				speed = 25;
			}
			
			oc = oc + step;
			
			setTimeout('fadeIn()',speed);
	
			/*
			if(oc<100) {
				oc=oc+3;
				setTimeout('fadeIn()',20);
			} */
		
		}

	function ChallengeLogin() {

		$('password').disabled = true;

		passphrase = MD5($('challenge').value + MD5($('password').value));
		$('passphrase').value = passphrase;

		var tmp = '';
		for(i=0;i<$('password').value.length;i++) { tmp+='*'; }
		$('password').value = tmp;

	}

		
	if (window.attachEvent) window.attachEvent("onload", fStart);

				
	</script>
	
{/literal}

<div id="bla" style="position: relative; top: 10%; width: 100%; text-align: center;"><center><div style="width: 450px">
<table cellpadding="0" cellspacing="0">
	<tr height="12" >
		<td id="tl" width="12" background="{$Sys_DesignSharedPath}/images/form/corner_topleft.gif" style="filter:Alpha(opacity=0,finishopacity=0,style=2)"></td>
		<td id="tc" background="{$Sys_DesignSharedPath}/images/form/shadow_top.gif" style="filter:Alpha(opacity=0,finishopacity=0,style=2)"></td>
		<td id="tr" width="12" background="{$Sys_DesignSharedPath}/images/form/corner_topright.gif" style="filter:Alpha(opacity=0,finishopacity=0,style=2)"></td>
	</tr>
	<tr height="300">
		<td id="ml" width="12" background="{$Sys_DesignSharedPath}/images/form/shadow_left.gif" style="filter:Alpha(opacity=0,finishopacity=0,style=2)"></td>
		<td>
			<table cellpadding="0" cellspacing="0" height="100%" style="background-image:url({$Sys_DesignSharedPath}/images/form/form-bg.gif); background-position:bottom; background-repeat:repeat-x;">
				<tr>
					<td style="padding-bottom:3px;">
						<table width="100%" height="100%" cellpadding="0" cellspacing="0" style="text-shadow:Black;">
							<tr>
								<td colspan="2" height="104" background="{$Sys_DesignSharedPath}/images/balken_01.gif" style="border-left:3px solid #FFFFFF; border-top:3px solid #FFFFFF; border-right:3px solid #FFFFFF;">
									<table width="100%" height="100%" cellpadding="0" cellspacing="0">
										<tr>
											<td style="font-size:25px; padding-top:35px; text-align: left;" valign="top"">
												<font color="#FFFFFF"><b>&nbsp;eCMS-Login</b></font>
											</td>
										</tr>
										<tr>
											<td style="font-size:12px; padding-right:2px; padding-bottom:2px;" align="right" valign="bottom">
												<font color="#FFFFFF"><b>Domain:</b> {$LoginManager_Domain}</font>
											</td>
										</tr>
									</table>
								</td>
							</tr>
							<tr>
								<td colspan="2" height="25" background="{$Sys_DesignSharedPath}/images/balken_02.gif" align="right" style="border-left:3px solid #FFFFFF; border-right:3px solid #FFFFFF; ">
									<font color="white" style="font-weight:bold">Serverzeit: {$smarty.now|date_format:"%d.%m.%Y %H:%M:%S"}&nbsp;</font>
								</td>
							</tr>
							<tr>
								<td colspan="2" height="10"></td>
							</tr>
							<tr>
								<td valign="top" style="padding-left:3px;"><img src="{$Sys_DesignSharedPath}/images/security.gif" alt="Login" width="128" height="128"></td>
								<td style="padding-right:3px;">
									<table border="0" cellpadding="5" cellspacing="0" height="100%" width="250" style="table-layout:fixed;">
										<tr>
											<td align="left">
												<b>{$LoginManager_Message}<br></b>
												<br>
												
												<table cellspacing="0" width="100%">
													<form name="AuthForm" method="post" action="{$Sys_CurrenPageURL}">
														<tr>
															<td style="padding-left:0;" height="25">Benutzername:&nbsp;&nbsp;</td>
															<td><div style="border:1px solid #CCCCCC; width:150px;"><input type="text" id="username" name="username" value="" style="border:none;width:100%;"></div></td>
														</tr>
														<tr>
															<td style="padding-left:0;">Kennwort:</td>
															<td><div style="border:1px solid #CCCCCC;"><input type="password" name="password" id="password" style="border:none;width:100%;"></div></td>
														</tr>
														<tr>
															<td style="padding-left:0;" colspan="2" align="right">
																<input type="submit" onclick="ChallengeLogin()" style="width: 80px;" value="Anmelden">
															</td>
														</tr>
														<input type="hidden" id="passphrase" name="passphrase">
														<input type="hidden" id="challenge" name="challenge" value="{$LoginManager_Challenge}">
														<input type="hidden" name="redirect" value="{$smarty.get.redirect|escape:"url"}">
													</form>
													
												</table>
													</td></tr>
													<tr height="100%">
														<td align="right" valign="bottom"><hr>
															<a href="?page=login&amp;method=lostpass" onclick="javascript:return false;">Kennwort vergessen?</a>&nbsp;&nbsp;
															<a href="mailto:support@ebyte.ch">Kontakt</a>											
														</td>
													</tr>
												</table>
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</td>
				<td id="mr" width="12" background="{$Sys_DesignSharedPath}/images/form/shadow_right.gif" style="filter:Alpha(opacity=0,finishopacity=0,style=2;"></td>
			</tr>
			<tr height="12">
				<td id="bl" width="12" background="{$Sys_DesignSharedPath}/images/form/corner_bottomleft.gif" style="filter:Alpha(opacity=0,finishopacity=0,style=2;"></td>
				<td id="bc" background="{$Sys_DesignSharedPath}/images/form/shadow_bottom.gif" style="filter:Alpha(opacity=0,finishopacity=0,style=2;"></td>
				<td id="br" width="12" background="{$Sys_DesignSharedPath}/images/form/corner_bottomright.gif" style="filter:Alpha(opacity=0,finishopacity=0,style=2;"></td>
			</tr>
		</table>
	</td>
  </tr>
</table>												
</div></center></div>

{else}
Current logged in as: {$Sys_CurrentUser->GetRealname()}
{$Page_Text}
{/if}
